import weakref
from functools import partial
from typing import Any, Callable, Dict


class Observable:
    """可监听对象的基类（需继承此类）"""

    def __setattr__(self, attr: str, value: Any):
        """拦截属性赋值"""
        if attr == "app_status":
            old = getattr(self, attr, None)
            if old != value:
                return True
        return False
